package ai.people.netmon.framework.domain.graph.tags;

import ai.people.netmon.framework.domain.graph.BaseTag;
import ai.people.netmon.framework.domain.archives.vo.ArchivesVO;
import com.alibaba.fastjson.PropertyNamingStrategy;
import com.alibaba.fastjson.annotation.JSONType;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;

/**
 * 公司tag
 *
 * @author zhenglin
 * @date 2022/4/25
 */
@Data
@NoArgsConstructor
@JSONType(naming = PropertyNamingStrategy.SnakeCase)
public class WorkTag extends BaseTag {
    /**
     * 开始时间
     */
    private String startTime;
    /**
     * 结束时间
     */
    private String endTime;

    /**
     * 公司
     */
    @NotBlank(message = "公司名不能为空")
    private String company;

    /**
     * 职位
     */
    private String position;

    /**
     * 收入
     */
    private String income;

    public WorkTag(ArchivesVO.Work x) {
        this.startTime = x.getStartTime();
        this.endTime = x.getEndTime();
        this.company = x.getCompany();
        this.position = x.getPosition();
        this.income = x.getIncome() == null ? null : x.getIncome().toString();
    }
}
